﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FetionWebMessenger.AddWebService;
namespace FetionWebMessenger
{
    public partial class WebServiceAction : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpRequest request = this.Page.Request;
            String action = request.Params["action"];
            HttpResponse response = this.Page.Response;
            response.ContentType = "text/xml";
            response.AppendHeader("Cache-Control", "no-cache");
            String result = "<?xml version='1.0' encoding='UTF-8'?><response>";
            switch (action)
            {
                case "getSupportProvince_weather":
                    result += FetionWebMessenger.AddWebService.WeatherProvider.GetSupportProvince();
                    break;
                case "getSupportCity_weather":
                    string Province = request.Params["province"];
                    result += FetionWebMessenger.AddWebService.WeatherProvider.GetSupportCity(Province);
                    break;
                default:
                    result += "未定义的方法";
                    break;
            }
            result += "</response>";
            response.Write(result);
        }
    }
}
